Optimal. Leaf size=62 \[ \frac{A+i B}{2 d (a+i a \tan (c+d x))}-\frac{x (-B+i A)}{2 a}+\frac{A \log (\sin (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.109208, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.094, Rules used = {3596, 3531, 3475} \[ \frac{A+i B}{2 d (a+i a \tan (c+d x))}-\frac{x (-B+i A)}{2 a}+\frac{A \log (\sin (c+d x))}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3596
Rule 3531
Rule 3475
Rubi steps
\begin{align*} \int \frac{\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx &=\frac{A+i B}{2 d (a+i a \tan (c+d x))}+\frac{\int \cot (c+d x) (2 a A-a (i A-B) \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac{(i A-B) x}{2 a}+\frac{A+i B}{2 d (a+i a \tan (c+d x))}+\frac{A \int \cot (c+d x) \, dx}{a}\\ &=-\frac{(i A-B) x}{2 a}+\frac{A \log (\sin (c+d x))}{a d}+\frac{A+i B}{2 d (a+i a \tan (c+d x))}\\ \end{align*}
Mathematica [B] time = 0.938486, size = 150, normalized size = 2.42 \[ \frac{\cos (c+d x) (A+B \tan (c+d x)) \left (\tan (c+d x) \left (2 A \log \left (\sin ^2(c+d x)\right )+2 i A d x-A+2 B d x-i B\right )-4 i A \tan ^{-1}(\tan (d x)) (\tan (c+d x)-i)-2 i A \log \left (\sin ^2(c+d x)\right )+2 A d x-i A-2 i B d x+B\right )}{4 a d (\tan (c+d x)-i) (A \cos (c+d x)+B \sin (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.103, size = 136, normalized size = 2.2 \begin{align*} -{\frac{3\,\ln \left ( \tan \left ( dx+c \right ) -i \right ) A}{4\,ad}}-{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) B}{ad}}-{\frac{{\frac{i}{2}}A}{ad \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{B}{2\,ad \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{A\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{4\,ad}}+{\frac{{\frac{i}{4}}B\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{ad}}+{\frac{A\ln \left ( \tan \left ( dx+c \right ) \right ) }{ad}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.41324, size = 186, normalized size = 3. \begin{align*} \frac{{\left ({\left (-6 i \, A + 2 \, B\right )} d x e^{\left (2 i \, d x + 2 i \, c\right )} + 4 \, A e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) + A + i \, B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.15723, size = 117, normalized size = 1.89 \begin{align*} \frac{A \log{\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} + \begin{cases} \frac{\left (A + i B\right ) e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text{for}\: 4 a d e^{2 i c} \neq 0 \\x \left (\frac{3 i A - B}{2 a} - \frac{\left (3 i A e^{2 i c} + i A - B e^{2 i c} - B\right ) e^{- 2 i c}}{2 a}\right ) & \text{otherwise} \end{cases} + \frac{x \left (- 3 i A + B\right )}{2 a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.37828, size = 135, normalized size = 2.18 \begin{align*} -\frac{\frac{{\left (3 \, A + i \, B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac{{\left (A - i \, B\right )} \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} - \frac{4 \, A \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a} - \frac{3 \, A \tan \left (d x + c\right ) + i \, B \tan \left (d x + c\right ) - 5 i \, A + 3 \, B}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]